import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";

@Entity()
export class Permission {
    @PrimaryGeneratedColumn()
    id: number;
    @Column({
        length: 50
    })
    code: string;

    @Column({
        default: 0,
        length: 50
    })
    pCode: string;

    @Column({
        length: 50
    })
    name: string;
    
    @Column({
        length: 100,
        nullable: true
    })
    desc: string;

    @CreateDateColumn({
        type: 'timestamp',
        comment: '创建时间',
        default: null,
        name: 'create_time'
    })
    createTime: Date;

    @UpdateDateColumn({
        type: 'timestamp',
        comment: '更新时间',
        default: null,
        name: 'update_time'
    })
    updateTime: Date;
}